<template>
  <div>
    <el-card>
      <el-row :gutter="20"></el-row>
      <el-form :model="editForm"  ref="editFormRef" label-width="280px" class="demo-ruleForm">
        <el-form-item label="未接单&下单时间X分钟内，全额退款" prop="inMinute">
          <el-input v-model="editForm.inMinute" style="width: 120px" />分钟
        </el-form-item>
        <el-form-item label="未接单&不满足全额退收取服务费" prop="outMinuteServiceFeePercent">
          <el-input v-model="editForm.outMinuteServiceFeePercent" style="width: 120px" />%
        </el-form-item>
        <el-form-item label="距离开场时间" prop="toPlayTimeMinutue">
          <el-input v-model="editForm.toPlayTimeMinutue" style="width: 120px" />分钟
        </el-form-item>
        <el-form-item label="未取票开场前Y分钟以上退票将收取服务费"  prop="serviceFeePercentOut">
          <el-input v-model="editForm.serviceFeePercentOut" style="width: 120px" />%
        </el-form-item>
        <el-form-item label="未取票开场前Y分钟以内退票将收取服务费"  prop="serviceFeePercentIn">
          <el-input v-model="editForm.serviceFeePercentIn" style="width: 120px" />%
        </el-form-item>
        <el-form-item label="注意事项" >
          <quill-editor
              v-model="editForm.orderNote"
              :options="editorOption"
              ref="myQuillEditor" style="width: 82%;height: 320px;"/>
        </el-form-item>
        <el-form-item style="margin-top: 80px;">
          <el-button type="primary" @click="saveCfg()">保 存</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import Api from "@/api/MemberApplyRefund.js";
export default {
  data() {
    return {
      queryInfo: {
      },
      editorOption: {
        //符文本编辑器的配置
        placeholder: "",
      },
      editForm:{
        inMinute:2,
        outMinuteServiceFeePercent:90,
        toPlayTimeMinutue:60,
        serviceFeePercentOut:95,
        serviceFeePercentIn:99,
        'orderNote':''
      }
    };
  },
  created() {
    this.getCfg();
  },
  methods: {
    getCfg() {
      Api.getCfg(this.queryInfo).then((res) => {
        if (res.success) {
          if(res.data){
            this.editForm = res.data;
          }
        } else {
          return this.$message.error("获取失败");
        }
      });
    },
    saveCfg() {
      Api.saveCfg(this.editForm).then((res) => {
        if (res.success) {
          return this.$message.success("保存成功");
        } else {
          return this.$message.error("失败：" + res.msg);
        }
      });
    }
  }
};
</script>

<style lang="less" scoped>
.logo_pic {
  max-width: 100px;
}
</style>
